<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0068)http://www.manyi100.com/User/User_Article.asp?ChannelID=1&Action=Add -->
<HTML>
	<HEAD>
		<TITLE>编辑用户</TITLE>
		<LINK href="<%=request.getContextPath()%>/jsp/manage/css/User_Style.css" type=text/css rel=stylesheet>
		<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
		<style type="text/css">
<!--
.style5 {
	color: #660000
}

.style6 {
	color: #006600
}
-->
</style>
	</HEAD>
	<script type="text/javascript">
function CheckForm(){
	var str;
	str=document.myform.name.value.replace(/\s+/g, '');
	if (str==''){
	   alert('姓名不能为空！');
	   document.myform.name.focus();
	   return false;
	}
	str=document.myform.password.value.replace(/\s+/g, '');
	if (str==''){
	   alert('密码不能为空！');
	   document.myform.password.focus();
	   return false;
	}
	if (!checkPWD(form.pw1.value)) {
		alert("错误！密码必须是字母数字或_！");
		return false;
	}
	str=document.myform.email.value.replace(/\s+/g, '');
	if (str==''){
	   alert('EMail不能为空！');
	   document.myform.email.focus();
	   return false;
	}else{
	    if(document.myform.email.value.indexOf("@")==-1||document.myform.email.value.indexOf(".")==-1)
	    {
	       window.alert("请输入正确的E-mail地址！")
	       document.myform.email.focus();
	       return false;
	    }
	 }
	return true;  
}
function checkPWD(input)
{
        var checkOK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
        var checkStr = input;
        for (i=0;i < checkStr.length;i++)
        {
                ch = checkStr.charAt(i);

                for (j = 0;  j < checkOK.length;  j++)
                        if (ch == checkOK.charAt(j))
                                break;
            if (j == checkOK.length)
                  {
                        return 0;
                        break;
                }
        }
        return 1;
 }
</script>
	<BODY topMargin="0" marginheight="0" marginwidth="0">

		<FORM name="myform" action="<%=request.getContextPath()%>/quanxianManage.do?method=usereditsave&id=${user.id}"
		onsubmit="return CheckForm();" method="post" target="_self">
			<TABLE class="border" cellSpacing="0" cellPadding="0" width="100%"
				align="center" border="0">
				<TBODY>
					<TR class="topbg">
						<TD height=22 colSpan=2 align=middle><STRONG>编辑用户</STRONG><br></TD>
					</TR>
					<TR align=middle>
						<TD>
							<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
								<TBODY>
									<TR class=tdbg>
										<TD align=right width=9%>
											&nbsp;
										</TD>
										<TD colspan="10">
											<FONT color=#ff0000><STRONG>注意<font
													color="#0000ff">*的内容必须填</font> </STRONG> </FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>登录ID：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id='username' maxlength=255 size=50 name='username' value=${user.username} >
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>登录密码：</STRONG>
										</TD>
										<TD colSpan=2>
											<input type="password" id='password' maxlength=255 size=52 name='password'  value=${user.password} >
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>姓名：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id="name" maxlength=255 size=50 name="name"  value=${user.name} >
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>E-Mail：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id='email' maxlength=255 size=50 name='email'  value=${user.email} >
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg id=ArticleContent>
										<TD align=right width=120>
											<STRONG>加入用户组：</STRONG>
										</TD>
										<TD colSpan=2>
											<select name="group">
												<option value="${groups.id}" selected>
													${groups.groupName}
												</option>
												<logic:iterate id="w" name="group_list"
													indexId="count">
													<option value="${w[0]}">
														${w[1]}
													</option>
												</logic:iterate>
											</select>
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</TD>
					</TR>
					<tr align="center">
						<td colspan="2">
							<input type="submit" name="SEND" value="保存数据">
							<input type="reset" value="清掉重写">
						</td>
					</tr>
				</TBODY>
			</TABLE>
			<BR>
		</FORM>
	</BODY>
</HTML>
